import {fileURLToPath, URL} from 'node:url'

import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import vueDevTools from 'vite-plugin-vue-devtools'

// https://vite.dev/config/
export default defineConfig({
    base: './',
    plugins: [
        vue(),
        vueJsx(),
        // vueDevTools(),
    ],

    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    },

    server: {
        port: 5170, //指定端口号

        /*
        proxy: {  //跨域代理-仅开发生效
            '/api': {
                target: 'http://localhost:8800',
                changeOrigin: true, // 是否改变源
                rewrite: (path) => path.replace(/^\/api/, '') //路径重写
            }
        }
        */


    },

    build: {
        outDir: 'dist',
    }

})
